//
//  MoreComicTableViewCell.m
//  Comic
//
//  Created by Ryan on 16/3/17.
//  Copyright © 2016年 程锦. All rights reserved.
//

#import "MoreComicTableViewCell.h"

@implementation MoreComicTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self createView];
    }
    return self;
}


- (void)createView{

    self.mainImageView = [UIImageView new];
    
    [self.contentView addSubview:self.mainImageView];
    
    self.title = [UILabel new];
    
    self.title.font = [UIFont systemFontOfSize:15];
    
    self.title.textColor = [UIColor grayColor];
    
    [self.contentView addSubview:self.title];
    
    self.nickname = [UILabel new];
    
    [self.contentView addSubview:self.nickname];
    
    self.nickname.font = [UIFont systemFontOfSize:12];
    
    self.nickname.textColor = [UIColor lightGrayColor];

    
    self.likes_count = [UILabel new];
    
    [self.contentView addSubview:self.likes_count];
    
    
    self.likes_count.font = [UIFont systemFontOfSize:12];
    
    self.likes_count.textColor = [UIColor lightGrayColor];
    
    self.comments_count = [UILabel new];
    
    [self.contentView addSubview:self.comments_count];
    
    
    self.comments_count.font = [UIFont systemFontOfSize:12];
    
    self.comments_count.textColor = [UIColor lightGrayColor];
    
    self.likes = [UIImageView new];
    
    [self.contentView addSubview:self.likes];
    
    self.comments = [UIImageView new];
    
    [self.contentView addSubview:self.comments];
    
    self.focus = [UIButton buttonWithType:UIButtonTypeCustom];
    
    [self.contentView addSubview:self.focus];
        


}


- (void)layoutSubviews{

    [super layoutSubviews];
    
    
    [self.mainImageView mas_makeConstraints:^(MASConstraintMaker *make) {
       
        make.left.top.mas_equalTo(8);
        make.bottom.mas_equalTo(-8);
        make.width.mas_equalTo(150);
        
        
        
        
    }];
    
    [self.title mas_makeConstraints:^(MASConstraintMaker *make) {
       
        make.left.mas_equalTo(self.mainImageView.mas_right).offset(8);
        make.top.mas_equalTo(8);
        make.right.mas_equalTo(self.focus.mas_left);
        make.height.mas_equalTo(15);
        
    }];
    
    [self.nickname mas_makeConstraints:^(MASConstraintMaker *make) {
       
        make.left.mas_equalTo(self.mainImageView.mas_right).offset(8);

        make.top.mas_equalTo(self.title.mas_bottom).offset(8);
        
        make.width.mas_equalTo(200);
        
        make.height.mas_equalTo(13);
    }];

    [self.likes mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(self.mainImageView.mas_right).offset(8);
        make.bottom.mas_equalTo(-8);
        make.width.height.mas_equalTo(15);
        
    }];
    
    [self.likes_count mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(self.likes.mas_right).offset(4);
        make.bottom.mas_equalTo(-8);
        make.height.mas_equalTo(15);
        make.width.mas_equalTo(50);
        
        
    }];
    
    [self.comments mas_makeConstraints:^(MASConstraintMaker *make) {
       
        make.left.mas_equalTo(self.likes_count.mas_right).offset(8);
        make.bottom.mas_equalTo(-8);
        make.width.height.mas_equalTo(15);

    }];
    
    [self.comments_count mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.left.mas_equalTo(self.comments.mas_right).offset(4);
        make.bottom.mas_equalTo(-8);
        make.height.mas_equalTo(15);
        make.width.mas_equalTo(50);
 
        
    }];
    
    [self.focus mas_makeConstraints:^(MASConstraintMaker *make) {
       
        make.top.mas_equalTo(8);
        make.right.mas_equalTo(-8);
        make.height.mas_equalTo(25);
        make.width.mas_equalTo(50);
        
        
    }];
    
}


@end
